package

        com.rightrule.controller;

import java.util.Arrays;
import java.util.Map;

import com.rightrule.entity.DecisionFieldTestEntity;
import com.rightrule.service.DecisionFieldTestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


import com.rightrule.common.utils.PageUtils;
import com.rightrule.common.utils.R;


/**
 * 策略变量测试表
 *
 * @author xiaowu
 * @email 980951938@qq.com
 * @date 2024-08-07 21:54:38
 */
@RestController
@RequestMapping("code/decisionfieldtest")
public class DecisionFieldTestController {
    @Autowired
    private DecisionFieldTestService decisionFieldTestService;

    /**
     * 列表
     */
    @RequestMapping("/list")
        public R list(@RequestParam Map<String, Object> params) {
        PageUtils page = decisionFieldTestService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
        public R info(@PathVariable("id") Long id) {
            DecisionFieldTestEntity decisionFieldTest = decisionFieldTestService.getById(id);

        return R.ok().put("decisionFieldTest", decisionFieldTest);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
        public R save(@RequestBody DecisionFieldTestEntity decisionFieldTest) {
            decisionFieldTestService.save(decisionFieldTest);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
        public R update(@RequestBody DecisionFieldTestEntity decisionFieldTest) {
            decisionFieldTestService.updateById(decisionFieldTest);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
        public R delete(@RequestBody Long[]ids) {
            decisionFieldTestService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
